import type { PaidDetailVO, PaidDetailForm, PaidDetailQuery } from './model';

import type { ID, IDS } from '#/api/common';
import type { PageResult } from '#/api/common';

import { commonExport } from '#/api/helper';
import { requestClient } from '#/api/request';

/**
* 查询支出详情列表
* @param params
* @returns 支出详情列表
*/
export function paidDetailList(params?: PaidDetailQuery) {
  return requestClient.get<PageResult<PaidDetailVO>>('/trade/paidDetail/list', { params });
}

/**
 * 导出支出详情列表
 * @param params
 * @returns 支出详情列表
 */
export function paidDetailExport(params?: PaidDetailQuery) {
  return commonExport('/trade/paidDetail/export', params ?? {});
}

/**
 * 查询支出详情详情
 * @param id id
 * @returns 支出详情详情
 */
export function paidDetailInfo(id: ID) {
  return requestClient.get<PaidDetailVO>(`/trade/paidDetail/${id}`);
}

/**
 * 新增支出详情
 * @param data
 * @returns void
 */
export function paidDetailAdd(data: PaidDetailForm) {
  return requestClient.postWithMsg<void>('/trade/paidDetail', data);
}

/**
 * 更新支出详情
 * @param data
 * @returns void
 */
export function paidDetailUpdate(data: PaidDetailForm) {
  return requestClient.putWithMsg<void>('/trade/paidDetail', data);
}

/**
 * 删除支出详情
 * @param id id
 * @returns void
 */
export function paidDetailRemove(id: ID | IDS) {
  return requestClient.deleteWithMsg<void>(`/trade/paidDetail/${id}`);
}
